const im = {
  state: {
    isConnected: false,
    chatMsgList: []
  },
  mutations: {
    SET_IS_CONNECTED(state, data) {
      state.isConnected = data;
    },
    SET_CHAT_MSG_LIST(state, data) {
      state.chatMsgList.push(data);
    }
  },
  actions: {
    CONNECT({ commit }) {
      commit("SET_IS_CONNECTED", true);
    },
    DISCONNECT({ commit }) {
      commit("SET_IS_CONNECTED", false);
    }
  }
};

export default im;
